<?xml version="1.0" encoding="iso-8859-1" ?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:tr="http://myfaces.apache.org/trinidad">
<f:view>
    <tr:document title="Maak een uitslag voor etappe #{requestContext.pageFlowScope['stageSequence']}">
        <tr:form id="makeStageResultForm">
            <tr:messages globalOnly="true"/>
            <tr:panelFormLayout>
                <tr:selectOneChoice id="resultTypeSelect"
                                    unselectedLabel="Selecteer een type uitslag" label="Type uitslag"
                                    valuePassThru="true" autoSubmit="true" immediate="true"
                                    valueChangeListener="#{makeStageResultDialog.onChangeResultType}"
                                    value="#{makeStageResultDialog.selectedResultType}">
                    <f:selectItems id="resultTypeItems" value="#{makeStageResultDialog.resultTypeItems}"
                                   var="stageResultTypeItem"
                                   itemValue="#{stageResultTypeItem.value}"
                                   itemLabel="#{stageResultTypeItem.label}"/>
                </tr:selectOneChoice>
                <tr:inputNumberSpinbox id="resultDetailCountInput"
                                       value="#{makeStageResultDialog.stageResultDetailCount}"
                                       valueChangeListener="#{makeStageResultDialog.onChangeDetailCount}"
                                       label="Details in uitslag"
                                       partialTriggers="resultTypeSelect" autoSubmit="true"/>
                <tr:selectOneChoice unselectedLabel="Selecteer uit de lijst of maak een nieuwe Locatie" label="Locatie"
                                    value="#{makeStageResultDialog.selectedLocation}" valuePassThru="true"
                                    autoSubmit="true" immediate="true">
                    <f:selectItems id="locationItems" value="#{makeStageResultDialog.locationItems}"
                                   var="locationItem"
                                   itemValue="#{locationItem.value}"
                                   itemLabel="#{locationItem.label}"/>
                </tr:selectOneChoice>
                <tr:inputText label="Locatienaam"
                              value="#{makeStageResultDialog.makeStageResultMAO.makeLocationMAO.name}"/>
                <tr:selectOneChoice unselectedLabel="Selecteer uit de lijst of maak een nieuw Land" label="Land"
                                    value="#{makeStageResultDialog.selectedCountry}"
                                    valuePassThru="true" autoSubmit="true" immediate="true">
                    <f:selectItems id="countryItems" value="#{makeStageResultDialog.countryItems}"
                                   var="countryItem"
                                   itemValue="#{countryItem.value}"
                                   itemLabel="#{countryItem.label}"/>
                </tr:selectOneChoice>
                <tr:inputText label="Landnaam"
                              value="#{makeStageResultDialog.makeStageResultMAO.makeLocationMAO.makeCountryMAO.name}"/>
                <tr:inputText label="ISO 3166 landcode" maximumLength="2" columns="3"
                              value="#{makeStageResultDialog.makeStageResultMAO.makeLocationMAO.makeCountryMAO.countryCode}"/>
                <tr:table partialTriggers="resultTypeSelect resultDetailCountInput"
                          value="#{makeStageResultDialog.stageResultDetails}" var="stageResultDetail"
                          allDetailsEnabled="true" rows="10">
                    <f:facet name="header">
                        <tr:outputText value="Details"/>
                    </f:facet>
                    <tr:column headerText="Plaats" align="right">
                        <tr:outputText value="#{stageResultDetail.rank}"/>
                    </tr:column>
                    <tr:column headerText="Punten" rendered="#{makeStageResultDialog.pointsDetailRendered}">
                        <tr:inputText value="#{stageResultDetail.points}" maximumLength="2" columns="3"/>
                    </tr:column>
                    <tr:column headerText="Coureur">
                        <tr:inputText value="#{stageResultDetail.yerseyNumber}" maximumLength="3" columns="4"/>
                    </tr:column>
                </tr:table>
                <tr:panelButtonBar>
                    <tr:commandButton text="Maken"
                                      actionListener="#{makeStageResultDialog.makeStageResult}"/>
                </tr:panelButtonBar>
            </tr:panelFormLayout>
        </tr:form>
    </tr:document>
</f:view>
</html>